/*   1:    */ package gov.sat.tax.fwsk.rz;
/*   2:    */ 
/*   3:    */ import gov.sat.tax.fwsk.common.ConnectionPoolBean;
/*   4:    */ import gov.sat.tax.fwsk.common.TransFormatServlet;
/*   5:    */ import java.io.IOException;
/*   6:    */ import java.io.PrintStream;
/*   7:    */ import java.io.Serializable;
/*   8:    */ import java.sql.Connection;
/*   9:    */ import java.sql.PreparedStatement;
/*  10:    */ import java.sql.ResultSet;
/*  11:    */ import java.sql.SQLException;
/*  12:    */ import java.util.Vector;
/*  13:    */ import javax.servlet.ServletException;
/*  14:    */ 
/*  15:    */ public class WsrzQyUserManageCmdBean
/*  16:    */   implements Serializable
/*  17:    */ {
/*  18:    */   private String nsrsbh;
/*  19:    */   private String nsrmc;
/*  20:    */   private String swjg_dm;
/*  21:    */   private String czydm;
/*  22:    */   private String czypwd;
/*  23:    */   private int yx_yccs;
/*  24:    */   private String jzrq;
/*  25:    */   private String khrq;
/*  26:    */   private String swjg_mc;
/*  27:    */   private String yxbz;
/*  28:    */   private String ekey;
/*  29:    */   private String nkey;
/*  30:    */   private String zcm;
/*  31:    */   private String ds_swjgdm;
/*  32:    */   private String gdzc_bz;
/*  33:    */   
/*  34:    */   public WsrzQyUserManageCmdBean() {}
/*  35:    */   
/*  36:    */   public WsrzQyUserManageCmdBean(ResultSet rs)
/*  37:    */     throws SQLException
/*  38:    */   {
/*  39: 46 */     this.swjg_dm = rs.getString(1);
/*  40: 47 */     this.nsrsbh = rs.getString(2);
/*  41: 48 */     this.nsrmc = TransFormatServlet.unicodeToGB(rs.getString(3));
/*  42: 49 */     this.yx_yccs = rs.getInt(4);
/*  43: 50 */     this.czydm = TransFormatServlet.unicodeToGB(rs.getString(5));
/*  44: 51 */     this.jzrq = rs.getString(6);
/*  45: 52 */     this.yxbz = rs.getString(7);
/*  46:    */   }
/*  47:    */   
/*  48:    */   public static WsrzQyUserManageCmdBean doQueryByCzydm(Connection conn, String nsr, String czy, String pwd, boolean isNeedPwd)
/*  49:    */     throws SQLException
/*  50:    */   {
/*  51: 61 */     WsrzQyUserManageCmdBean uBean = null;
/*  52: 62 */     ResultSet rs = null;
/*  53:    */     
/*  54:    */ 
/*  55:    */ 
/*  56:    */ 
/*  57:    */ 
/*  58: 68 */     String sSqlstmt = "select B.SWJG_DM,A.YX_YCCS,A.CZYDM,A.CZYPWD,A.YXBZ,To_Char(A.JZRQ,'YYYY-MM-DD') as SJZRQ ,B.GDZC_BZ from HTJS.WSRZ_QY_KHXX A,HTJS.ht_ybnsr_dab B where A.NSRSBH = '" + nsr + "' and B.NSRSBH='" + nsr + "' AND B.YXBZ='N' ";
/*  59: 69 */     if (isNeedPwd) {
/*  60: 70 */       sSqlstmt = sSqlstmt + " and A.CZYDM = '" + czy + "' and A.CZYPWD = '" + pwd + "'";
/*  61:    */     }
/*  62: 86 */     PreparedStatement stmt = null;
/*  63:    */     try
/*  64:    */     {
/*  65: 90 */       stmt = conn.prepareStatement(sSqlstmt, 1003, 1007);
/*  66:    */       
/*  67: 92 */       rs = stmt.executeQuery();
/*  68: 93 */       if (rs.next())
/*  69:    */       {
/*  70: 96 */         String swjgdm = rs.getString(1) == null ? "" : rs.getString(1);
/*  71: 97 */         String czy1dm = rs.getString(3) == null ? "" : rs.getString(3);
/*  72: 98 */         String czy1pwd = rs.getString(4) == null ? "" : rs.getString(4);
/*  73: 99 */         String jzr = rs.getString(6) == null ? "" : rs.getString(6);
/*  74:    */         
/*  75:    */ 
/*  76:102 */         uBean = new WsrzQyUserManageCmdBean();
/*  77:103 */         uBean.setSwjg_dm(swjgdm);
/*  78:104 */         uBean.setYx_yccs(rs.getInt(2));
/*  79:105 */         uBean.setCzydm(czy1dm);
/*  80:106 */         uBean.setCzypwd(czy1pwd);
/*  81:107 */         uBean.setYxbz(rs.getString(5));
/*  82:108 */         uBean.setJzrq(jzr);
/*  83:109 */         uBean.setGdzc_bz(rs.getString(7));
/*  84:    */       }
/*  85:    */     }
/*  86:    */     catch (SQLException e)
/*  87:    */     {
/*  88:115 */       System.out.println("[ERROR] WsrzQyUserManageCmdBean.doQueryByCzydm() Exception: " + e);
/*  89:116 */       conn.close();
/*  90:    */     }
/*  91:    */     finally
/*  92:    */     {
/*  93:120 */       if (stmt != null)
/*  94:    */       {
/*  95:122 */         stmt.close();
/*  96:123 */         rs.close();
/*  97:    */       }
/*  98:    */     }
/*  99:126 */     return uBean;
/* 100:    */   }
/* 101:    */   
/* 102:    */   public static WsrzQyUserManageCmdBean doQueryByPwd(Connection conn, String nsr, String czy, String pwd)
/* 103:    */     throws SQLException
/* 104:    */   {
/* 105:136 */     WsrzQyUserManageCmdBean uBean = null;
/* 106:137 */     ResultSet rs = null;
/* 107:    */     
/* 108:    */ 
/* 109:    */ 
/* 110:    */ 
/* 111:142 */     String sSqlstmt = "select B.SWJG_DM,A.YX_YCCS,A.CZYDM,A.CZYPWD,A.YXBZ,To_Char(A.JZRQ,'YYYY-MM-DD') as SJZRQ from HTJS.WSRZ_QY_KHXX A,HTJS.ht_ybnsr_dab B  where A.NSRSBH = '" + 
/* 112:143 */       nsr + "' and A.CZYDM = '" + czy + "' and A.CZYPWD = '" + pwd + "' and B.NSRSBH='" + nsr + "' AND B.YXBZ='N' ";
/* 113:    */     
/* 114:145 */     PreparedStatement stmt = null;
/* 115:    */     try
/* 116:    */     {
/* 117:149 */       stmt = conn.prepareStatement(sSqlstmt, 1003, 1007);
/* 118:    */       
/* 119:151 */       rs = stmt.executeQuery();
/* 120:152 */       if (rs.next())
/* 121:    */       {
/* 122:154 */         String swjgdm = rs.getString(1) == null ? "" : rs.getString(1);
/* 123:155 */         String czy1dm = rs.getString(3) == null ? "" : rs.getString(3);
/* 124:156 */         String czy1pwd = rs.getString(4) == null ? "" : rs.getString(4);
/* 125:157 */         String jzr = rs.getString(6) == null ? "" : rs.getString(6);
/* 126:    */         
/* 127:159 */         uBean = new WsrzQyUserManageCmdBean();
/* 128:160 */         uBean.setSwjg_dm(swjgdm);
/* 129:161 */         uBean.setYx_yccs(rs.getInt(2));
/* 130:162 */         uBean.setCzydm(czy1dm);
/* 131:163 */         uBean.setCzypwd(czy1pwd);
/* 132:164 */         uBean.setYxbz(rs.getString(5));
/* 133:165 */         uBean.setJzrq(jzr);
/* 134:    */       }
/* 135:    */     }
/* 136:    */     catch (SQLException e)
/* 137:    */     {
/* 138:170 */       System.out.println("[ERROR] WsrzQyUserManageCmdBean.doQueryByCzydm() Exception: " + e);
/* 139:171 */       conn.close();
/* 140:    */     }
/* 141:    */     finally
/* 142:    */     {
/* 143:175 */       if (stmt != null)
/* 144:    */       {
/* 145:177 */         stmt.close();
/* 146:178 */         rs.close();
/* 147:    */       }
/* 148:    */     }
/* 149:181 */     return uBean;
/* 150:    */   }
/* 151:    */   
/* 152:    */   public static boolean doVerify(Connection conn, String sbh)
/* 153:    */     throws SQLException
/* 154:    */   {
/* 155:191 */     return true;
/* 156:    */   }
/* 157:    */   
/* 158:    */   public String doDelete(Connection conn)
/* 159:    */     throws SQLException
/* 160:    */   {
/* 161:233 */     String errMsg = "";
/* 162:234 */     PreparedStatement stmt = null;
/* 163:    */     
/* 164:236 */     String sSqlstmt = "delete from HTJS.WSRZ_QY_KHXX where NSRSBH = '" + this.nsrsbh + "'";
/* 165:    */     try
/* 166:    */     {
/* 167:240 */       stmt = conn.prepareStatement(sSqlstmt);
/* 168:241 */       stmt.executeUpdate();
/* 169:242 */       conn.commit();
/* 170:    */     }
/* 171:    */     catch (SQLException e)
/* 172:    */     {
/* 173:246 */       errMsg = "WsrzQyUserManageCmdBean.doDelete() Exception: " + e.toString().replace('\n', ' ').replace('"', '\'');
/* 174:    */     }
/* 175:    */     finally
/* 176:    */     {
/* 177:250 */       if (stmt != null) {
/* 178:251 */         stmt.close();
/* 179:    */       }
/* 180:    */     }
/* 181:253 */     return errMsg;
/* 182:    */   }
/* 183:    */   
/* 184:    */   public String doInsert(Connection conn)
/* 185:    */     throws SQLException
/* 186:    */   {
/* 187:263 */     String errMsg = "";
/* 188:264 */     String sSqlstmt = 
/* 189:265 */       "insert into HTJS.WSRZ_QY_KHXX values('" + this.nsrsbh + "','" + 
/* 190:266 */       TransFormatServlet.GBToUnicode(this.nsrmc) + "','" + this.swjg_dm + "','" + 
/* 191:267 */       TransFormatServlet.GBToUnicode(this.czydm) + "','" + this.czypwd + "'," + this.yx_yccs + 
/* 192:268 */       ",To_Date('" + this.jzrq + "','YYYY-MM-DD'),SYSDATE,'" + this.yxbz + "','" + 
/* 193:269 */       this.ekey + "','" + this.nkey + "','" + this.zcm + "')";
/* 194:    */     
/* 195:271 */     PreparedStatement stmt = null;
/* 196:    */     try
/* 197:    */     {
/* 198:274 */       stmt = conn.prepareStatement(sSqlstmt);
/* 199:275 */       stmt.executeUpdate();
/* 200:    */     }
/* 201:    */     catch (SQLException e)
/* 202:    */     {
/* 203:279 */       errMsg = "WsrzQyUserManageCmdBean.doInsert() Exception: " + e.toString().replace('\n', ' ').replace('"', '\'');
/* 204:    */     }
/* 205:    */     finally
/* 206:    */     {
/* 207:283 */       if (stmt != null) {
/* 208:284 */         stmt.close();
/* 209:    */       }
/* 210:    */     }
/* 211:286 */     return errMsg;
/* 212:    */   }
/* 213:    */   
/* 214:    */   public Vector doQuery(Connection conn)
/* 215:    */     throws SQLException
/* 216:    */   {
/* 217:294 */     Vector vRetn = new Vector();
/* 218:295 */     ResultSet rs = null;
/* 219:296 */     String sSqlstmt = 
/* 220:297 */       "select A.NSRMC,A.SWJG_DM,A.CZYDM,A.CZYPWD,A.YX_YCCS,To_Char(A.JZRQ,'YYYY-MM-DD') as SJZRQ,A.YXBZ,B.SWJG_MC from HTJS.WSRZ_QY_KHXX A,HTJS.HT_SWJG_DMB B where A.NSRSBH = '" + 
/* 221:    */       
/* 222:    */ 
/* 223:300 */       this.nsrsbh + "' and A.SWJG_DM = B.SWJG_DM";
/* 224:301 */     PreparedStatement stmt = null;
/* 225:    */     try
/* 226:    */     {
/* 227:304 */       stmt = conn.prepareStatement(sSqlstmt);
/* 228:305 */       rs = stmt.executeQuery();
/* 229:306 */       if (rs.next())
/* 230:    */       {
/* 231:308 */         WsrzQyUserManageCmdBean uBean = new WsrzQyUserManageCmdBean();
/* 232:309 */         uBean.setNsrsbh(this.nsrsbh);
/* 233:310 */         uBean.setNsrmc(TransFormatServlet.unicodeToGB(rs.getString(1)));
/* 234:311 */         uBean.setSwjg_dm(rs.getString(2));
/* 235:312 */         uBean.setCzydm(TransFormatServlet.unicodeToGB(rs.getString(3)));
/* 236:313 */         uBean.setCzypwd(rs.getString(4));
/* 237:314 */         uBean.setYx_yccs(rs.getInt(5));
/* 238:315 */         uBean.setJzrq(rs.getString(6));
/* 239:316 */         uBean.setYxbz(rs.getString(7));
/* 240:317 */         uBean.setSwjg_mc(TransFormatServlet.unicodeToGB(rs.getString(8)));
/* 241:318 */         vRetn.addElement(uBean);
/* 242:    */       }
/* 243:    */     }
/* 244:    */     catch (SQLException e)
/* 245:    */     {
/* 246:323 */       throw new SQLException("WsrzQyUserManageCmdBean.doQuery() Exception: " + e.toString().replace('\n', ' ').replace('"', '\''));
/* 247:    */     }
/* 248:    */     finally
/* 249:    */     {
/* 250:327 */       if (stmt != null) {
/* 251:328 */         stmt.close();
/* 252:    */       }
/* 253:    */     }
/* 254:330 */     return vRetn;
/* 255:    */   }
/* 256:    */   
/* 257:    */   public String doUpdate(Connection conn)
/* 258:    */     throws SQLException
/* 259:    */   {
/* 260:338 */     String errMsg = "";
/* 261:339 */     String sSqlstmt = null;String pwd = "";
/* 262:341 */     if ((this.czypwd != null) && (this.czypwd.length() > 0)) {
/* 263:343 */       pwd = ",CZYPWD = '" + this.czypwd + "'";
/* 264:    */     }
/* 265:345 */     sSqlstmt = 
/* 266:    */     
/* 267:    */ 
/* 268:    */ 
/* 269:349 */       "update HTJS.WSRZ_QY_KHXX set YX_YCCS = " + this.yx_yccs + ",CZYDM = '" + TransFormatServlet.GBToUnicode(this.czydm) + "'" + pwd + ",JZRQ = To_Date('" + this.jzrq + "','YYYY-MM-DD'),YXBZ = '" + this.yxbz + "' where NSRSBH = '" + this.nsrsbh + "'";
/* 270:    */     
/* 271:351 */     PreparedStatement stmt = null;
/* 272:    */     try
/* 273:    */     {
/* 274:354 */       stmt = conn.prepareStatement(sSqlstmt);
/* 275:355 */       stmt.executeUpdate();
/* 276:    */     }
/* 277:    */     catch (SQLException e)
/* 278:    */     {
/* 279:359 */       errMsg = "WsrzQyUserManageCmdBean.doUpdate() Exception: " + e.toString().replace('\n', ' ').replace('"', '\'');
/* 280:    */     }
/* 281:    */     finally
/* 282:    */     {
/* 283:363 */       if (stmt != null) {
/* 284:364 */         stmt.close();
/* 285:    */       }
/* 286:    */     }
/* 287:366 */     return errMsg;
/* 288:    */   }
/* 289:    */   
/* 290:    */   public String doRebuild(Connection conn)
/* 291:    */     throws SQLException
/* 292:    */   {
/* 293:371 */     String errMsg = "";
/* 294:372 */     String sSqlstmt = null;
/* 295:    */     
/* 296:374 */     sSqlstmt = 
/* 297:375 */       "update HTJS.WSRZ_QY_KHXX set ekey = '" + this.ekey + "',nkey ='" + this.nkey + 
/* 298:376 */       "' where NSRSBH = '" + this.nsrsbh + "'";
/* 299:    */     
/* 300:378 */     PreparedStatement stmt = null;
/* 301:    */     try
/* 302:    */     {
/* 303:381 */       stmt = conn.prepareStatement(sSqlstmt);
/* 304:382 */       stmt.executeUpdate();
/* 305:    */     }
/* 306:    */     catch (SQLException e)
/* 307:    */     {
/* 308:386 */       errMsg = "WsrzQyUserManageCmdBean.doRebuild() Exception: " + e.toString().replace('\n', ' ').replace('"', '\'');
/* 309:    */     }
/* 310:    */     finally
/* 311:    */     {
/* 312:390 */       if (stmt != null) {
/* 313:391 */         stmt.close();
/* 314:    */       }
/* 315:    */     }
/* 316:393 */     return errMsg;
/* 317:    */   }
/* 318:    */   
/* 319:    */   public String getCzydm()
/* 320:    */   {
/* 321:401 */     return this.czydm;
/* 322:    */   }
/* 323:    */   
/* 324:    */   public String getCzypwd()
/* 325:    */   {
/* 326:409 */     return this.czypwd;
/* 327:    */   }
/* 328:    */   
/* 329:    */   public String getNsrmc()
/* 330:    */   {
/* 331:417 */     return this.nsrmc;
/* 332:    */   }
/* 333:    */   
/* 334:    */   public String getNsrsbh()
/* 335:    */   {
/* 336:425 */     return this.nsrsbh;
/* 337:    */   }
/* 338:    */   
/* 339:    */   public String getSwjg_dm()
/* 340:    */   {
/* 341:433 */     return this.swjg_dm;
/* 342:    */   }
/* 343:    */   
/* 344:    */   public int getYx_yccs()
/* 345:    */   {
/* 346:441 */     return this.yx_yccs;
/* 347:    */   }
/* 348:    */   
/* 349:    */   public void setCzydm(String czydm)
/* 350:    */   {
/* 351:449 */     this.czydm = czydm;
/* 352:    */   }
/* 353:    */   
/* 354:    */   public void setCzypwd(String czypwd)
/* 355:    */   {
/* 356:457 */     this.czypwd = czypwd;
/* 357:    */   }
/* 358:    */   
/* 359:    */   public void setNsrmc(String nsrmc)
/* 360:    */   {
/* 361:465 */     this.nsrmc = nsrmc;
/* 362:    */   }
/* 363:    */   
/* 364:    */   public void setNsrsbh(String nsrsbh)
/* 365:    */   {
/* 366:473 */     this.nsrsbh = nsrsbh;
/* 367:    */   }
/* 368:    */   
/* 369:    */   public void setSwjg_dm(String swjg_dm)
/* 370:    */   {
/* 371:481 */     this.swjg_dm = swjg_dm;
/* 372:    */   }
/* 373:    */   
/* 374:    */   public void setYx_yccs(int yx_yccs)
/* 375:    */   {
/* 376:489 */     this.yx_yccs = yx_yccs;
/* 377:    */   }
/* 378:    */   
/* 379:    */   public String getSwjg_mc()
/* 380:    */   {
/* 381:497 */     return this.swjg_mc;
/* 382:    */   }
/* 383:    */   
/* 384:    */   public void setSwjg_mc(String swjg_mc)
/* 385:    */   {
/* 386:505 */     this.swjg_mc = swjg_mc;
/* 387:    */   }
/* 388:    */   
/* 389:    */   public String getJzrq()
/* 390:    */   {
/* 391:513 */     return this.jzrq;
/* 392:    */   }
/* 393:    */   
/* 394:    */   public String getKhrq()
/* 395:    */   {
/* 396:521 */     return this.khrq;
/* 397:    */   }
/* 398:    */   
/* 399:    */   public void setJzrq(String jzrq)
/* 400:    */   {
/* 401:529 */     this.jzrq = jzrq;
/* 402:    */   }
/* 403:    */   
/* 404:    */   public void setKhrq(String khrq)
/* 405:    */   {
/* 406:537 */     this.khrq = khrq;
/* 407:    */   }
/* 408:    */   
/* 409:    */   public String getYxbz()
/* 410:    */   {
/* 411:545 */     return this.yxbz;
/* 412:    */   }
/* 413:    */   
/* 414:    */   public void setYxbz(String yxbz)
/* 415:    */   {
/* 416:553 */     this.yxbz = yxbz;
/* 417:    */   }
/* 418:    */   
/* 419:    */   public String getEkey()
/* 420:    */   {
/* 421:560 */     return this.ekey;
/* 422:    */   }
/* 423:    */   
/* 424:    */   public String getNkey()
/* 425:    */   {
/* 426:568 */     return this.nkey;
/* 427:    */   }
/* 428:    */   
/* 429:    */   public void setEkey(String ekey)
/* 430:    */   {
/* 431:576 */     this.ekey = ekey;
/* 432:    */   }
/* 433:    */   
/* 434:    */   public void setNkey(String nkey)
/* 435:    */   {
/* 436:584 */     this.nkey = nkey;
/* 437:    */   }
/* 438:    */   
/* 439:    */   public String getZcm()
/* 440:    */   {
/* 441:592 */     return this.zcm;
/* 442:    */   }
/* 443:    */   
/* 444:    */   public void setZcm(String zcm)
/* 445:    */   {
/* 446:600 */     this.zcm = zcm;
/* 447:    */   }
/* 448:    */   
/* 449:    */   public String getDs_swjgdm()
/* 450:    */   {
/* 451:607 */     return this.ds_swjgdm;
/* 452:    */   }
/* 453:    */   
/* 454:    */   public void setDs_swjgdm(String string)
/* 455:    */   {
/* 456:614 */     this.ds_swjgdm = string;
/* 457:    */   }
/* 458:    */   
/* 459:    */   public String getGdzc_bz()
/* 460:    */   {
/* 461:621 */     return this.gdzc_bz;
/* 462:    */   }
/* 463:    */   
/* 464:    */   public void setGdzc_bz(String string)
/* 465:    */   {
/* 466:628 */     this.gdzc_bz = string;
/* 467:    */   }
/* 468:    */   
/* 469:    */   public static String doQueryVerify(String nsr)
/* 470:    */     throws ServletException, IOException
/* 471:    */   {
/* 472:641 */     ConnectionPoolBean handler = ConnectionPoolBean.getHandle();
/* 473:642 */     Connection conn = null;
/* 474:643 */     PreparedStatement stmt = null;
/* 475:644 */     String rstr = "no";
/* 476:    */     try
/* 477:    */     {
/* 478:647 */       conn = handler.getConnection();
/* 479:648 */       if (conn != null)
/* 480:    */       {
/* 481:650 */         String Sqls = "select nsrsbh from htjs.wsrz_qy_khxx_sj where nsrsbh='" + nsr + "' ";
/* 482:    */         try
/* 483:    */         {
/* 484:654 */           System.out.println(Sqls);
/* 485:655 */           stmt = conn.prepareStatement(Sqls, 1003, 1007);
/* 486:656 */           ResultSet rs = stmt.executeQuery();
/* 487:657 */           if (rs.next()) {
/* 488:659 */             rstr = rs.getString("nsrsbh");
/* 489:    */           }
/* 490:    */         }
/* 491:    */         catch (SQLException e)
/* 492:    */         {
/* 493:666 */           System.out.println("[error] 查询开户信息出现异常 " + e.getMessage());
/* 494:672 */           if (stmt != null) {
/* 495:674 */             stmt.close();
/* 496:    */           }
/* 497:687 */           if (conn != null) {}
/* 498:667 */           return "no";
/* 499:    */         }
/* 500:    */         finally
/* 501:    */         {
/* 502:    */           //String Sqls;
/* 503:672 */           if (stmt != null) {
/* 504:674 */             stmt.close();
/* 505:    */           }
/* 506:    */         }
/* 507:    */       }
/* 508:678 */       return rstr;
/* 509:    */     }
/* 510:    */     catch (Exception e)
/* 511:    */     {
/* 512:682 */       System.out.println("[error] xml 文件返回出现异常 " + e.getMessage());
/* 513:683 */       return "no";
/* 514:    */     }
/* 515:    */     finally
/* 516:    */     {
/* 517:687 */       if (conn != null)
/* 518:    */       {
/* 519:689 */         handler.closeConnection(conn);
/* 520:690 */         conn = null;
/* 521:    */       }
/* 522:    */     }
/* 523:    */   }
/* 524:    */ }


/* Location:           D:\htjs\document\wsrz\WsrzEjbInf\
 * Qualified Name:     gov.sat.tax.fwsk.rz.WsrzQyUserManageCmdBean
 * JD-Core Version:    0.7.0.1
 */